package ar.com.solidussource.howmuchmobile.activities.list;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.location.Address;
import android.location.Geocoder;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import ar.com.solidussource.howmuchmobile.R;
import ar.com.solidussource.howmuchmobile.activities.ProductCategoryListOnCreateProductActivity;
import ar.com.solidussource.howmuchmobile.activities.generic.BaseActivity;

import java.io.IOException;
import java.util.Iterator;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: FT31270775
 * Date: 26/06/13
 * Time: 15:39
 * To change this template use File | Settings | File Templates.
 */
public class AddressSearchGeocoderActivity extends BaseActivity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View v = (View) inflater.inflate(R.layout.address_search, null);

        final EditText nameText = (EditText) v.findViewById(R.id.nameText);

        Button category = (Button) v.findViewById(R.id.search);

        category.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(AddressSearchGeocoderActivity.this, AddressListActivity.class);
                intent.putExtra("addressName", nameText.getText().toString());
                //intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
                startActivity(intent);
            }
        });

        setContent(v);
    }
}